package com.mku.wms_service.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mku.wms_service.common.QueryPageParam;
import com.mku.wms_service.common.Response;

import com.mku.wms_service.dto_vo.RecordVO;
import com.mku.wms_service.entity.Record;
import com.mku.wms_service.service.IRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author maoxx
 * @since 2024-11-22
 */
@RestController
@RequestMapping("/record")
public class RecordController {

    @Autowired
    private IRecordService recordService;


    @ApiOperation("添加记录")
    @PostMapping
    public Response<Boolean> add(@RequestBody Record record) {
        return recordService.add(record);
    }


    @ApiOperation(("分页查询"))
    @PostMapping("/listPage")
    public Response<IPage<RecordVO>> listPage(@RequestBody QueryPageParam qp2) {
        return recordService.listPage(qp2);
    }

}
